import { kgjHttp as http } from '@/services/http';
import type { OrderResult, OrderReqParam, UserResult, UserReqParam } from '@/types/api/kgj/commune';
import type { SortAndLimit, ListResult } from '@/types/api/common';

/** 获取用户列表 */
export const getUserList = (payload: { data: UserReqParam; params: SortAndLimit }) =>
  http<ListResult<UserResult>, UserReqParam, SortAndLimit>({
    url: '/api/commune/user/list',
    method: 'post',
    ...payload
  });

/** 获取订单列表 */
export const getOrderList = (payload: { data: OrderReqParam; params: SortAndLimit }) =>
  http<ListResult<OrderResult>, OrderReqParam, SortAndLimit>({
    url: '/api/commune/order/list',
    method: 'post',
    ...payload
  });

